package com.marcowu.study.spb.tracing.zipkin;

import io.opentracing.Tracer;
import io.opentracing.contrib.okhttp3.TracingInterceptor;
import okhttp3.OkHttpClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ZipkinConfig {

  private Tracer tracer = TracerBuiler.getZipkinTracer("sample1");

  @Bean
  public OkHttpClient httpClient() {
    return TracingInterceptor.addTracing(new OkHttpClient.Builder(), tracer);
  }


}
